package entity;

import java.util.Random;

/**
 * 方向枚举
 * 
 * @author lijia
 *
 */
public enum Direction {
	LEFT,
	RIGHT,
	UP,
	DOWN;

	public static Direction randomDirection() {
		Random random = new Random();
		int len = random.nextInt(Direction.values().length);
		switch (len) {
			case 0:
				return LEFT;
			case 2:
				return UP;
			case 3:
				return DOWN;
			default:
				return RIGHT;
		}
	}
}
